package cn.luo.entity;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

//文章表
@Document("t_blogs")
public class Blogs {
    @Id
    private String id;          //主键
    @Indexed
    private String uid;         //用户id
    private String author;     //作者
    private String contentid;  //主要内容的id
    private String tagid;     //类型id
    private String title;      //标题
    private Date time=new Date();         //发表时间
    private int count;        //阅读次数
    private String digest;    //摘要

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getContentid() {
        return contentid;
    }

    public void setContentid(String contentid) {
        this.contentid = contentid;
    }

    public String getTagid() {
        return tagid;
    }

    public void setTagid(String tagid) {
        this.tagid = tagid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    @Override
    public String toString() {
        return "Blogs{" +
                "id='" + id + '\'' +
                ", uid='" + uid + '\'' +
                ", author='" + author + '\'' +
                ", contentid='" + contentid + '\'' +
                ", tagid='" + tagid + '\'' +
                ", title='" + title + '\'' +
                ", time=" + time +
                ", count=" + count +
                ", digest='" + digest + '\'' +
                '}';
    }
}
